________________________________________________________________________
Macintosh Sample Code

#2: TESample

by Mark Bennett, Rick Blair and Dave Radcliffe

Versions:		1.00 					08/88
				1.01					11/88
				1.02					04/89

Components: 	TESample.p				April 1, 1989
				TESample.c				April 1, 1989
				TESampleGlue.a			April 1, 1989	-MPW only-
				TESample.r				April 1, 1989
				TESample.h				April 1, 1989
				PTESample.make			April 1, 1989	-MPW only-
				CTESample.make			April 1, 1989	-MPW only-
				TESampleGlue.s			April 1, 1989	-A/UX only-
				TESampleAUX.r			April 1, 1989	-A/UX only-
				Makefile				April 1, 1989	-A/UX only-
________________________________________________________________________

Major changes since 1.0
The way that memory availability is checked and handled at initialization has been
revamped. The way windows are closed has changed sustantially. An error message dialog
has been added to better inform users, and error handling in general is much  improved.
Finally, a funny hack was put into the C version so that we could call PurgeSpace under
MPW 2.0.2.

Search in the code for Ò1.01Ó to find all the specific changes.

Major changes since 1.01
Any dependency on MPW 2.0 has been removed; this version requires MPW 3.0 or later.
An improvement was made to TrapAvailable to handle differences between Pre-MacII
machines and MacII and later machines.

A/UX programmers - 1.02 introduces conditional compilation for compilation
under A/UX 1.1. Note that the binary file compiled under MPW will run fine under
A/UX. The changes were made to the source as an example of how to make source
files capable of being compiled under both MPW and AU/X.

Search in the code for Ò1.02Ó to find all the specific changes.
________________________________________________________________________

TESample is an example application that demonstrates how to initialize the commonly used
toolbox managers, operate successfully under MultiFinder, handle desk accessories and
create, grow, and zoom windows. The fundamental TextEdit toolbox calls and TextEdit
autoscroll are demonstrated. It also shows how to create and maintain scrollbar controls.

It does not by any means demonstrate all the techniques you need for a large application.
In particular, TESample does not cover exception handling, multiple windows/documents,
sophisticated memory management, printing, or undo. All of these are vital parts of a
normal full-sized application.

This application is an example of the form of a Macintosh application; it is NOT a
template. It is NOT intended to be used as a foundation for the next world-class,
best-selling, 600K application. A stick figure drawing of the human body may be a good
example of the form for a painting, but that does not mean it should be used as the
basis for the next Mona Lisa.

We recommend that you review this program or Sample before beginning a new application.
Sample is a simple app. which doesnÕt use TextEdit or the Control Manager.

